<?php
//2015404233吴长猷
require_once 'db_conn.php';

 $e_name=$_POST['e_name'];
 $e_dept=$_POST['e_dept'];
 $e_img=$_POST['e_img'];
 $date_of_birth=$_POST['date_of_birth'];
 $date_of_entry=$_POST['date_of_entry'];
 //写sql
 $sql="insert into tb_emp(e_name,e_dept,e_img,date_of_birth,date_of_entry) values('$e_name','$e_dept','$e_img','$date_of_birth','$date_of_entry')";
 $result=$db->query($sql);
 
 if ($result)
    {
        echo "<script language='javascript' type='text/javascript'>";
        echo "alert('留言成功');";
        echo "window.location.href='index.php'";
        echo "</script>";
    }
 else 
    {
        echo "<script language='javascript' type='text/javascript'>";
        echo "alert('留言失败！');";
        echo "window.location.href='index.php'";
        echo "</script>";
    
    }
